import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

import org.korifey.ffalg.NumberTheory;
import org.korifey.ffalg.Probabilities;


public class Problem16 {
	
	public static void main(String[] args) {
		System.out.println(solve());
	}

	final static int n = 1000;
	
		
	public static long solve() {			
		String s = new BigDecimal(2).pow(1000).toString();
		int res = 0;
		for (char c: s.toCharArray()) {
			res += c - '0';
		}
		return res;
	}
	
}
